<?php
    include_once 'Processing/Users/users.php';
    $users = get_users();
    global $user;
    
    /* Change password */
    if(!isset ($_POST['oldPassword']))
        $_POST['oldPassword'] = '';
    if(!isset ($_POST['newPassword']))
        $_POST['newPassword'] = '';
    if(!isset ($_POST['newPasswordRepeated']))
        $_POST['newPasswordRepeated'] = '';
    /* Add user */
    if(!isset ($_POST['username']))
        $_POST['username'] = '';
    if(!isset ($_POST['password']))
        $_POST['password'] = '';
    if(!isset ($_POST['passwordRepeated']))
        $_POST['passwordRepeated'] = '';

    echo messages(null);
    echo messages('other');
    
    add_mini_help('options');
?>
<div id="myPassword">
    <h2>Keisti savo slaptažodį:</h2>
    <form action="index.php?options" method="post">
        <input type="hidden" name="real_action_script" value="Processing/Users/users.php" />
        <input type="hidden" name="function" value="changePassword" />
        <label>Senas slaptažodis<input type="password" name="oldPassword" value="<?php echo $_POST['oldPassword']; ?>" /></label>
        <label>Naujas slaptažodis<input type="password" name="newPassword" value="<?php echo $_POST['newPassword']; ?>" /></label>
        <label>Pakartoti slaptažodį<input type="password" name="newPasswordRepeated" value="<?php echo $_POST['newPasswordRepeated']; ?>" /></label>
        <input type="submit" value="Keisti" />
    </form>
</div>
<div id="newUser">
    <h2>Sukurti naują naudotoją:</h2>
    <form action="index.php?options" method="post">
        <input type="hidden" name="real_action_script" value="Processing/Users/users.php" />
        <input type="hidden" name="function" value="newUser" />
        <label>Naudotojo vardas<input type="text" name="username" value="<?php echo $_POST['username']; ?>" /></label>
        <label>Naudotojo slaptažodis<input type="password" name="password" value="<?php echo $_POST['password']; ?>" /></label>
        <label>Pakartoti slaptažodį<input type="password" name="passwordRepeated" value="<?php echo $_POST['passwordRepeated']; ?>" /></label>
        <input type="submit" value="Pridėti" />
    </form>
</div>